package com.richest.api.controller.user;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.richest.api.controller.form.RegisterForm;
import com.richest.api.service.IUserService;
import com.richest.util.CallResults;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;

/**
 * 注册入口 2019年3月12日 上午10:49:07 richest-api
 * 
 * @author zhaohongchao
 * @version 1.0 ApiRegisterController.java
 */
@RestController
@RequestMapping("/registerController")
@Api(value = "注册接口")
@EnableAutoConfiguration
public class ApiRegisterController {
	@Autowired
	private IUserService userService;

	@RequestMapping(value = "register", produces = "application/json;charset=UTF-8")
	@ApiOperation(notes = "注册", value = "注册", httpMethod = "POST")
	@ApiImplicitParam(name = "form", value = "注册", required = true, dataType = "RegisterForm")
	public CallResults register(@RequestBody RegisterForm form) {
		return userService.register(form);
	}

	@RequestMapping(value = "register2", produces = "application/json;charset=UTF-8")
	@ApiOperation(notes = "注册", value = "注册", httpMethod = "POST")
	@ApiImplicitParam(name = "form", value = "注册", required = true, dataType = "RegisterForm")
	public CallResults test(@RequestBody RegisterForm form) {
		return userService.register(form);

	}

}
